#pragma once

#include "primitive.h"
#include "vector3.h"

namespace raytrace {

struct Material;
struct Ray;

class Sphere : public Primitive {
 public:
  Sphere(const Vector3& pos, float r, const Material* material);
  virtual ~Sphere() {}

  virtual bool IntersectsWith(const Ray& ray, float& d) const;
  virtual Vector3 NormalAt(const Vector3& pt) const;

  virtual Vector3 GetRandomPoint() const;
  
  virtual const char* type() const { return "sphere"; }

 private:
  float r_;
};
}
